package com.apes.fn.server.workOrder.repository;

import com.apes.fn.server.workOrder.model.ConstructionRecord;
import com.apes.fn.server.workOrder.model.MaintenanceOrder;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

/**
 * param:zyc
 **/
public interface ConstructRecordRepository extends CustomRepository<ConstructionRecord, String> {
        @Query(value = " SELECT S FROM ConstructionRecord S  "
                + " WHERE S.maintenanceOrder.id = :id AND S.operateType in :list order by S.createDate desc "
        )
        List<ConstructionRecord> findConstructionRecordForCalculate(@Param("id") String id,@Param("list") List<String> list);

//        List<ConstructionRecord> findFirstByMaintenanceOrderIdOrderByCreateDatedesc(String id);
}
